package com.sunshine.litemusic.fragment.search;

import java.util.Arrays;

/**
 * @author sunshine
 * @date 2020/5/28
 * 主活动的实体类
 */
public class SearchModel {

    /**
     * 搜索歌曲实体类
     */
    public class SearchBean{

        //歌曲名称
        private String name;
        //id
        private int id;
        //歌手
        private SingerBean[] ar;
        //歌曲
        private SongBean al;

        public SearchBean(String name, int id, SingerBean[] ar, SongBean al) {
            this.name = name;
            this.id = id;
            this.ar = ar;
            this.al = al;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public int getId() {
            return id;
        }

        public void setId(int id) {
            this.id = id;
        }

        public String getAr() {
            StringBuilder stringBuilder = new StringBuilder();
            for (SingerBean singerBean : ar){
                stringBuilder.append(singerBean).append(" ");
            }
            return stringBuilder.delete(stringBuilder.length() - 1, stringBuilder.length()).toString();
        }

        public void setAr(SingerBean[] ar) {
            this.ar = ar;
        }

        public SongBean getAl() {
            return al;
        }

        public void setAl(SongBean al) {
            this.al = al;
        }

        @Override
        public String toString() {
            return "SongBean{" +
                    "name='" + name + '\'' +
                    ", id=" + id +
                    ", ar=" + Arrays.toString(ar) +
                    ", al=" + al +
                    '}';
        }

        /**
         * 搜索歌手实体类
         */
        public class SingerBean{

            //歌手id
            private int id;
            //歌手名称
            private String name;

            private String[] tns;

            private String[] alias;

            public SingerBean(int id, String name, String[] tns, String[] alias) {
                this.id = id;
                this.name = name;
                this.tns = tns;
                this.alias = alias;
            }

            public int getId() {
                return id;
            }

            public void setId(int id) {
                this.id = id;
            }

            public String getName() {
                return name;
            }

            public void setName(String name) {
                this.name = name;
            }

            public String[] getTns() {
                return tns;
            }

            public void setTns(String[] tns) {
                this.tns = tns;
            }

            public String[] getAlias() {
                return alias;
            }

            public void setAlias(String[] alias) {
                this.alias = alias;
            }

            @Override
            public String toString() {
                return name + " ";
            }
        }

        /**
         * 搜索专辑实体类
         */
        public class SongBean{

            //专辑id
            private int id;
            //专辑名称
            private String name;
            //专辑图片地址
            private String picUrl;

            private String[] tns;

            private String pic_str;

            private int pic;

            public SongBean(int id, String name, String picUrl, String[] tns, String pic_str, int pic) {
                this.id = id;
                this.name = name;
                this.picUrl = picUrl;
                this.tns = tns;
                this.pic_str = pic_str;
                this.pic = pic;
            }

            public int getId() {
                return id;
            }

            public void setId(int id) {
                this.id = id;
            }

            public String getName() {
                return name;
            }

            public void setName(String name) {
                this.name = name;
            }

            public String getPicUrl() {
                return picUrl;
            }

            public void setPicUrl(String picUrl) {
                this.picUrl = picUrl;
            }

            public String[] getTns() {
                return tns;
            }

            public void setTns(String[] tns) {
                this.tns = tns;
            }

            public String getPic_str() {
                return pic_str;
            }

            public void setPic_str(String pic_str) {
                this.pic_str = pic_str;
            }

            public int getPic() {
                return pic;
            }

            public void setPic(int pic) {
                this.pic = pic;
            }

            @Override
            public String toString() {
                return "MusicBean{" +
                        "id=" + id +
                        ", name='" + name + '\'' +
                        ", picUrl='" + picUrl + '\'' +
                        ", tns=" + Arrays.toString(tns) +
                        ", pic_str='" + pic_str + '\'' +
                        ", pic=" + pic +
                        '}';
            }
        }
    }
}
